<template>
		<view >
			<pageIndex :myInfo = "showList" :banner="require('@/static/image/supervision/banner.png') "  :img="img"></pageIndex>
		</view>
</template>

<script>
	import { navList } from '@/mock/index/supervision.js';
	import pageIndex from '../../components/pageIndex.vue';
	import {
			mapState
		} from 'vuex';
	import {
		Index
	} from '@/api/index.js';
	export default {
		components: {
		  pageIndex
		},
		data() {
			return {
				navList,
				img:'',
				showList:[]
			};
		},
		computed: {
					...mapState(['userInfo'])
				},
		methods:{
			 async init(){
				 const res = await Index.getCover('精准监督')
				 if(res.data.list.length){
					 this.img=res.data.list[0].img_src
				 }
				console.log('ses',res)
			}
		},
		async onLoad(){
			await this.init()
			if(this.userInfo.user_role == 'normal'){
				this.showList = this.navList.filter(item=>{
					return item.title == "业务上报"
				})
			}else if(this.userInfo.user_role == 'leader'){
				this.showList = this.navList.filter(item=>{
					return item.title !== "业务上报"&&item.title !== "通报审核"
				})
			}else if(this.userInfo.user_role == 'boss'){
				this.showList = this.navList.filter(item=>{
					return item.title !== "业务上报"
				})
			}
			console.log(this.showList)
		}
	}
</script>

<style lang="scss">

</style>
